/**
 * Created by Administrator on 2017/1/21.
 */

var MJ = require('../MJ/MJ');

exports.JiStatus = {
    'CF': 1,     // 冲锋鸡
    'ZR': 2      // 责任鸡
}

exports.JiCate = {
    'SET': 1,       // 设定的鸡
    'HU': 2,        // 胡牌的鸡
    'KING': 3,      // 金鸡
}

var ScoreRule = clone(MJ.ScoreRule);
ScoreRule.BJ = 201;       // 包鸡
ScoreRule.DQB = 202;      // 豆全包
ScoreRule.QGSJ = 203;     // 抢杠烧鸡
ScoreRule.QGSD = 204;     // 抢杠烧豆

ScoreRule.YQ = 301;         // 原缺

var Pattern = {
    'NONE': 0,                // 不是可胡的牌型
    'NORMAL': 1,              // 平胡
    'PAIR': 2,                // 大对
    'PAIR7': 3,               // 七对
    'SINGLE': 4,              // 单调

    'NORMAL_COLOR': 15,      // 清一色

    'PAIR_COLOR': 25,        // 清大对

    'PAIR7_LONG': 32,       // 龙七对
    'PAIR7_COLOR': 35,      // 清七对
    'PAIR7_COLOR_LONG': 37,// 清龙对

    'SINGLE_COLOR': 45,     // 清单调
};

var PatternScore = {}
PatternScore[Pattern.NORMAL] = 1;
PatternScore[Pattern.PAIR] = 5;
PatternScore[Pattern.PAIR7] = 10;
PatternScore[Pattern.SINGLE] = 10;

PatternScore[Pattern.NORMAL_COLOR] = 10;
PatternScore[Pattern.PAIR_COLOR] = 15;
PatternScore[Pattern.PAIR7_LONG] = 20;
PatternScore[Pattern.PAIR7_COLOR] = 20;
PatternScore[Pattern.PAIR7_COLOR_LONG] = 30;
PatternScore[Pattern.SINGLE_COLOR] = 20;

var ItemScore = {};
ItemScore[ScoreRule.ZM] = 1;
ItemScore[ScoreRule.GSH] = 1;
ItemScore[ScoreRule.GSP] = 0;
ItemScore[ScoreRule.QG] = 0;
ItemScore[ScoreRule.BT] = 10;
ItemScore[ScoreRule.TH] = 10;
ItemScore[ScoreRule.DIHU] = 10;

var ScoreReason = {
    DH: MJ.Result.DH,  // 点胡/点炮
    ZM: MJ.Result.ZM,  // 自摸/被自摸
    PT: 10,             // 陪叫/查叫
    BJ: 11,             // 包鸡
    BG: 12,             // 包杠

    BT: ScoreRule.BT, // 报听
    LZ: ScoreRule.LZ,    // 连庄陪付/连庄获陪
    QG: ScoreRule.QG,    // 抢杠
};

var GangScore = {};
GangScore[MJ.Gang.BA] = 3;
GangScore[MJ.Gang.AN] = 3;
GangScore[MJ.Gang.DIAN] = 3;
GangScore[MJ.Gang.ANS] = 3;

exports.ScoreRule = ScoreRule;
exports.Pattern = Pattern;
exports.PatternScore = PatternScore;
exports.ItemScore = ItemScore;
exports.ScoreReason = ScoreReason;
exports.GangScore = GangScore;